package com.monitor.core.handler;

import com.alibaba.fastjson.JSON;
import com.monitor.core.bean.ControllerMonitorMessage;
import com.monitor.core.bean.MonitorMessage;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

/**
 * @Auther: hanhui.liu
 * @Date: 2018/4/24 14:18
 * @Description:
 */
@Component
public class ActiveMQMessageHandler extends MessageHandler {

    private static final Logger logger = Logger.getLogger(ActiveMQMessageHandler.class);

//    private static ActiveMQMessageHandler instance;


//    public static ActiveMQMessageHandler getInstance() {
//        if (instance == null) {
//            synchronized (ActiveMQMessageHandler.class) {
//                instance = new ActiveMQMessageHandler();
//            }
//        }
//        return instance;
//
//    }

    @Override
    public void send(MonitorMessage monitorMessage) {
        if (monitorMessage instanceof ControllerMonitorMessage) {

        }
        logger.info("ActiveMQMessage handler send start");
        logger.info(JSON.toJSONString(monitorMessage));
        logger.info("ActiveMQMessage handler send end");
    }
}
